package
{
	import away3d.containers.ObjectContainer3D;
	import away3d.materials.ColorMaterial;
	import away3d.materials.methods.SoftShadowMapMethod;
	import away3d.primitives.Cube;
	
	import flash.display.Sprite;
	import flash.filters.GlowFilter;

	public class Block extends ObjectContainer3D
	{
		
		
		public function Block(taille:int = 20)
		{
			
			/*graphics.beginFill(0xFF0000);
			//graphics.beginFill( (  (uint(Math.random()*255)) << 16    ) | (   (uint(Math.random()*255)) << 8   ) | (   uint(Math.random()*255)    ));
			graphics.drawRect(0,0,taille,taille);
			
			var filter:GlowFilter = new GlowFilter(0x770000, 1, 2, 2, 70, 10, true);
			this.filters = [filter];*/
			var matBase:ColorMaterial = new ColorMaterial(0xEE8659);
			matBase.ambient = 50;
			//matBase.smooth = true;
			matBase.lights = Main3D.getLigths();
			matBase.shadowMethod = Main3D.shadow;
			//matBase.specular = 1;
			// --- les objets
			// -- le cube			
			var cube:Cube;
			cube = new Cube(matBase, Tetris3D.LARGEUR_BLOCK_PX, Tetris3D.LARGEUR_BLOCK_PX, Tetris3D.LARGEUR_BLOCK_PX);
			cube.castsShadows = true;
			cube.x =  Tetris3D.LARGEUR_BLOCK_PX/2;
			cube.y =  Tetris3D.LARGEUR_BLOCK_PX/2;
			//cube.z = -cube.height/2;
			addChild(cube);
			
		}
	}
}